//
// Created by Administrator on 2021/01/05 005.
// 如果类中有指针类型变量，当有函数以该类作为参数，则必须实现复制构造函数
//
#include "Line.h"

Line::Line(int len){
    this->ptr = new int;
    *this->ptr = len;
}

int Line::getLength() {
    return *this->ptr;
}

Line::Line(const Line &other) {
    ptr = new int;
    *ptr = *other.ptr;
}

Line::~Line() {
    delete this->ptr;
}


